package jiglib_vf
{
	import away3d.containers.ObjectContainer3D;
	import away3d.primitives.Cube;
	import away3d.primitives.WireframeCube;
	
	import flash.geom.Matrix3D;
	
	import jiglib.math.JMatrix3D;
	import jiglib.plugin.ISkin3D;
	
	public class JVBox extends Object implements ISkin3D {
		private var _obj		: ObjectContainer3D;
		private var _matrix		: JMatrix3D;
		public function JVBox(a_obj: ObjectContainer3D) {
			super();
			_obj 	= a_obj;
			_matrix = new JMatrix3D();
		}
		
		public function get transform(): JMatrix3D {
			return _matrix;
		}
		
		public function set transform(m :JMatrix3D):void  {
			var v: Vector.<Number> = new Vector.<Number>(16);
			var index: int = 0;
			for (var i: int=1; i<=4; i++)
				for (var n: int=1; n<=4; n++) {
					v[index]= _matrix['n' + i.toString() + n.toString()];
					index ++;
				}
			_obj.transform = new Matrix3D(v); 
		}
	}
}